package net.xiduth.game.player.dialogues;


public class Titles extends Dialogue {

	@Override
	public void start() {
		stage = 1;
		if (stage == 1) {
			sendOptionsDialogue("Title Selection",
					"Junior Cadet (Free!)",
					"Lord/Lady (100 PvM Pts.)",
					"Hellraiser (3+ Killstreak)",
					"Archon (10+ Killstreak)",
					"Never mind.");
			stage = 1;
		}
	}

	public void run(int interfaceId, int componentId) {
		if (stage == 1) {
			if (componentId == OPTION_1)
		player.getAppearence().setTitle(1);
			player.getInterfaceManager().closeChatBoxInterface();
			if (componentId == OPTION_2)
				if (player.getPvMPoints() >= 100) {
					player.getAppearence().setTitle(6);
					player.getInterfaceManager().closeChatBoxInterface();
					stage = 3;
					}else{
					player.getPackets().sendGameMessage("You need 100 points for this title." );
					stage = 3;
					}
			if (componentId == OPTION_3)
				if (player.KillStreak >= 2) {
					player.getAppearence().setTitle(9);
					player.getInterfaceManager().closeChatBoxInterface();
					stage = 3;
					}else{
					stage = 3;
					player.getPackets().sendGameMessage("You need a killstreak of at least 3 to buy this." );
					}
			if (componentId == OPTION_4)
				if (player.KillStreak >= 9) {
					player.getAppearence().setTitle(29);
					player.getInterfaceManager().closeChatBoxInterface();
					stage = 3;
					}else{
					stage = 3;
					player.getPackets().sendGameMessage("You need a killstreak of at least 10 to buy this." );
					}
			if (componentId == OPTION_5)
				stage = 3;
		}
	if (stage == 3) {
		end();
	}
	}

	@Override
	public void finish() {

	}

}